﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/revoelectric.master" title="Bill Search | Revo" CodeFile="searchbill.aspx.cs" Inherits="searchbill" %>

<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="head">
</asp:Content>

<asp:Content ID="Content2" runat="server" ContentPlaceHolderID="widebarHeaderContentPlaceHolder">
	<table>
		<tr style="text-align: center; font-size: 14px; font-weight: bold;">
			<td><a href="generatebill.aspx"><img src="./Images/generateBills.png" height="60px" width="60px" alt="*"/></a><br/>Generate Bills</td>
			<td><a href="searchBill.aspx" ><img src="./Images/searchBills.png" height="60px" width="60px" alt="*"/></a><br/>Search Bills</td>
		</tr>
	</table>
</asp:Content>

<asp:Content runat="server" ID="searchbill_content" ContentPlaceHolderID="widebarBodyContentPlaceHolder">
    <form id="formBillingGrid" runat="server">
        <div>
		    <asp:GridView ID="GridViewBilling" runat="server" 
                AllowSorting="True" AutoGenerateColumns="False" DataSourceID="ccDb" 
                EnableModelValidation="True" BackColor="White" BorderColor="#999999" 
                BorderStyle="None" BorderWidth="1px" CellPadding="3" GridLines="Vertical" 
                AllowPaging="True" DataKeyNames="id" DataMember="DefaultView" 
                ShowFooter="True">
                <AlternatingRowStyle BackColor="#DCDCDC" />
                <Columns>
                    <asp:BoundField DataField="id" HeaderText="Billing Id" 
                        SortExpression="id" ReadOnly="true" />
                    <asp:BoundField DataField="cycle_start" HeaderText="Cycle Start" 
                        SortExpression="cycle_start" ReadOnly="true" />
                    <asp:BoundField DataField="cycle_end" HeaderText="Cycle End" 
                        SortExpression="cycle_end" ReadOnly="true" />
                    <asp:BoundField DataField="consumption" HeaderText="Consumption(kWh)" SortExpression="consumption" ReadOnly="true" />
                    <asp:BoundField DataField="due_date" HeaderText="Due Date" 
                        SortExpression="due_date" ReadOnly="true" />
					<asp:BoundField DataField="current_charge" HeaderText="Current Charge" 
						SortExpression="current_charge" ReadOnly="true" />
					<asp:BoundField DataField="previous_balance" HeaderText="Previous Balance" 
						SortExpression="previous_balance" ReadOnly="true" />
					<asp:BoundField DataField="total_charge" HeaderText="Total Charge" 
						SortExpression="total_charge" ReadOnly="true" />
					<asp:BoundField DataField="meter_id" HeaderText="Meter Id" 
						SortExpression="meter_id" ReadOnly="true" />
                </Columns>
                <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
                <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
                <RowStyle BackColor="#EEEEEE" ForeColor="Black" />
                <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
            </asp:GridView>
            <asp:SqlDataSource ID="ccDb" runat="server" 
                ConnectionString="<%$ ConnectionStrings:onwindConnectionString %>" 
                SelectCommand="sp_getAllFromBilling"
                UpdateCommand="sp_updateBillingConsumption">
                <UpdateParameters>
                    <asp:Parameter Name="consumption" Type="Decimal" />
                    <asp:Parameter Name="id" Type="Int32" />
                </UpdateParameters>
            </asp:SqlDataSource>
        </div>  
    </form> 
</asp:Content>


